import 'package:flutter/material.dart';

/// 用户登录/注册 输入框
class UserTextField extends StatelessWidget {
  final String hintText;
  final TextEditingController controller;
  final bool obscureText;
  final OutlineInputBorder _fieldBorder = const OutlineInputBorder(
    borderSide: BorderSide(color: Colors.grey),
  );

  const UserTextField({
    super.key,
    required this.hintText,
    required this.controller,
    this.obscureText = false,
  });

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: 40,
      child: TextField(
        controller: controller,
        obscureText: obscureText,
        decoration: InputDecoration(
          contentPadding: EdgeInsets.symmetric(horizontal: 8),
          hintText: hintText,
          border: _fieldBorder,
          enabledBorder: _fieldBorder,
          focusedBorder: _fieldBorder,
        ),
      ),
    );
  }
}
